const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)
}
module.exports = {
  pages: {
    // 主项目，入口页面
    index: {
      entry: 'src/main.js',
      // 模板来源
      template: 'public/index.html',
      title: '怪兽充电',
      chunks: ['chunk-vendors', 'chunk-common', 'index']
    },
    // 浏览器自定义主页
    newtab: {
      entry: "src/pages/newtab/newtab.js",
      template: "public/newtab.html",
      filename: "newtab.html",
      title: "newtab",
    },
    // 弹出popview页面
    popview: {
      template: "public/popview.html",
      entry: "src/pages/popview/popview.js",
      filename: "popview.html",
      title: "popview",
    },
    // options页面
    options: {
      template: "public/options.html",
      entry: "src/pages/options/options.js",
      filename: "options.html",
      title: "options",
    },
    panel: {
      template: "public/panel.html",
      entry: "src/pages/panel/panel.js",
      filename: "panel.html",
      title: "调试面板"
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': resolve('src')
      }
    }
  },
};
